require 'rvm/capistrano'
require 'bundler/capistrano'

set :application, "GroupNavigation"
set :rails_env, "production"
set :domain, "@uname.ws"
set :deploy_to, "/var/www/#{application}"
set :user, "dad"
set :use_sudo, false

set :scm, :git
set :repository,  "https://dad.remote@code.google.com/p/group-navigation/"

set :branch, "master"
set :deploy_via, :remote_cache

default_run_options[:pty] = true
ssh_options[:forward_agent] = true

# set :scm, :git # You can set :scm explicitly or Capistrano will make an intelligent guess based on known version control directory names
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`

server "uname.ws", :app, :web, :db, :primary => true
# role :web, "uname.ws"                          # Your HTTP server, Apache/etc
# role :app, "uname.ws"                          # This may be the same as your `Web` server
# role :db,  "uname.ws", :primary => true # This is where Rails migrations will run

# if you want to clean up old releases on each deploy uncomment this:
after "deploy:restart", "deploy:cleanup"

# if you're still using the script/reaper helper you will need
# these http://github.com/rails/irs_process_scripts

# If you are using Passenger mod_rails uncomment this:
namespace :deploy do
   task :start do ; end
   task :stop do ; end
   task :restart, :roles => :app, :except => { :no_release => true } do
     run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
   end
end